<?php

namespace app\admin\model\conference;

use think\Model;


class Conf extends Model
{
    // 表名
    protected $table = 'activity_conf';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'repeat_text',
        'meetingType_text',
        'status_text',
        'mainVideo_text',
        'mainAudio_text',
        'participantVideo_text',
        'participantAudio_text',
        'mode_text',
        'lock_text'
    ];

    public function getRepeatList()
    {
        return ['n' => __('Repeat n'), 'd' => __('Repeat d'), 'w' => __('Repeat w'), 's' => __('Repeat s'), 'm' => __('Repeat m')];
    }

    public function getMeetingtypeList()
    {
        return ['0' => __('Meetingtype 0'), '1' => __('Meetingtype 1')];
    }

    public function getStatusList()
    {
        return ['0' => __('Status 0'), '1' => __('Status 1')];
    }

    public function getMainvideoList()
    {
        return ['0' => __('Mainvideo 0'), '1' => __('Mainvideo 1')];
    }

    public function getMainaudioList()
    {
        return ['0' => __('Mainaudio 0'), '1' => __('Mainaudio 1')];
    }

    public function getParticipantvideoList()
    {
        return ['0' => __('Participantvideo 0'), '1' => __('Participantvideo 1')];
    }

    public function getParticipantaudioList()
    {
        return ['0' => __('Participantaudio 0'), '1' => __('Participantaudio 1')];
    }

    public function getModeList()
    {
        return ['freeCamera' => __('Mode freecamera'), 'mainBroadcast' => __('Mode mainbroadcast'), 'mainCamera' => __('Mode maincamera')];
    }

    public function getLockList()
    {
        return ['0' => __('Lock 0'), '1' => __('Lock 1')];
    }


    public function getRepeatTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['repeat']) ? $data['repeat'] : '');
        $list = $this->getRepeatList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMeetingtypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['meetingType']) ? $data['meetingType'] : '');
        $list = $this->getMeetingtypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMainvideoTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['mainVideo']) ? $data['mainVideo'] : '');
        $list = $this->getMainvideoList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMainaudioTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['mainAudio']) ? $data['mainAudio'] : '');
        $list = $this->getMainaudioList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getParticipantvideoTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['participantVideo']) ? $data['participantVideo'] : '');
        $list = $this->getParticipantvideoList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getParticipantaudioTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['participantAudio']) ? $data['participantAudio'] : '');
        $list = $this->getParticipantaudioList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getModeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['mode']) ? $data['mode'] : '');
        $list = $this->getModeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getLockTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['lock']) ? $data['lock'] : '');
        $list = $this->getLockList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
